<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:useBean id="cal" scope="request" class="com.etc.controll.Calculator"></jsp:useBean>
<jsp:setProperty property="*" name="cal"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
    <form name="form1" method="post" action="jisuan">
    <table width="317" height="190" border="1">
      <tr>
        <td colspan="2"><div align="center" class="STYLE1">计算器</div></td>
      </tr>
      <tr>
        <td width="152">第一个参数</td>
        <td width="149"><label>
          <input type="text" name="value1" id="value1">
        </label></td>
      </tr>
      <tr>
        <td>运算符</td>
        <td><label>
          <input type="radio" name="operatorNum" value="1">
        +</label>
          <label>
          <input type="radio" name="operatorNum" value="2">
        -</label>
          <label>
          <input type="radio" name="operatorNum" value="3">
        *</label>
          <label>
          <input type="radio" name="operatorNum" value="4">
        /</label></td>
      </tr>
      <tr>
        <td>第二个参数</td>
        <td><label>
          <input type="text" name="value2" id="value2">
        </label></td>
      </tr>
      <tr>
        <td colspan="2"><label>
          <input type="submit" name="Submit" value="提交">
          <input type="reset" name="Submit2" value="重置">
        </label></td>
      </tr>
    </table>
  </form>
  <%cal.caculate();
  out.println("运算结果："+cal.getResult());
   %>
  </body>
</html>
